home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 033a / prokit34.zip / CALLS.DOC < prev    next >
Text File  |  1991-04-01  |  10KB  |  307 lines

  1.  
  2. (*
  3.  * CALLS.DOC - Summary of DOOR support functions provided by ProKIT
  4.  *
  5.  * (C) 1988 Samuel H. Smith (rev. 04-aug-88)
  6.  *
  7.  *)
  8.  
  9. procedure init;
  10. {must be first - opens com port, loads setup and user data}
  11.  
  12. procedure uninit;
  13. {must be last - closes com port and updates database}
  14.  
  15. procedure close_down_door(messages: boolean);
  16. {same as uninit but does not send ANY messages to the caller
  17.  if called as close_down_door(false)}
  18.  
  19.  
  20. (* ---------------------------------------------------------------- *)
  21. (* high level input and output *)
  22.  
  23. procedure disp(msg: string);
  24.    {display a string without linefeed}
  25.  
  26. procedure displn(msg: string);
  27.    {display a string and linefeed, increments linenum}
  28.  
  29. procedure pdisp(msg: string);
  30.    {display a string without linefeed, allows $ and @ macros}
  31.  
  32. procedure pdispln(msg: string);
  33.    {display a string and linefeed, increments linenum, allows $ and @ macros}
  34.  
  35. procedure newline;
  36.    {C/R and linefeed, increments linenum}
  37.  
  38.    
  39. procedure display_file(name: string);
  40.    {displays the contents of named file;
  41.     automatic "more:" prompting;
  42.     adds "g" to filename in graphics mode}
  43.  
  44. procedure display_file_raw(name: string; number_lines);
  45.    {display a file with line numbers added}
  46.  
  47.  
  48. procedure input(var line: string;       {the variable to input into}
  49.                 maxlen: integer);       {maximum length of input}
  50.    {read a line of input with the specified length; echo to screen;
  51.     leaves cursor after the last key typed before C/R;
  52.     automatic check for time-left and carrier loss - sets dump_user}
  53.  
  54. procedure get_cmdline;      
  55.    {calls 'input' to read into 'cmdline', maps to upper case}
  56.  
  57. procedure get_nextpar;      
  58.    {scan next param from 'cmdline' into 'par'}
  59.  
  60. procedure wait_for_enter;   
  61.    {prompt "Press (enter) to continue: " only in novice mode}
  62.  
  63. procedure force_enter;
  64.    {prompt "Press (enter) to continue: "}
  65.  
  66. procedure position(x,y: byte);
  67.    {position cursor; graphics mode only}
  68.  
  69. procedure clear_screen;
  70.    {ease screen in current color; graphics mode only}
  71.  
  72. procedure clear_eol;
  73.    {clear to end of line; graphics mode only}
  74.  
  75.  
  76.  
  77. (* ---------------------------------------------------------------- *)
  78. (* high-level command-line input and prompt handlers *)
  79.  
  80. procedure get_cmdline_raw(prelength: integer);
  81.    {get a command line; prelength=0 for normal prompts.
  82.     if prelength > 0 then the user input and a prompt of prelength
  83.     characters will be erased from the screen after the input}
  84.  
  85. procedure prompt_def(prompt: string80; default: string80);
  86.    {display a prompt with a default value; example:
  87.         prompt_def('File to open:','(Enter)=none? ');}
  88.  
  89. procedure get_def(prompt: string80; default: string80);
  90.    {get input after displaying a prompt with a default}
  91.  
  92. procedure get_defn(prompt: string80; default: string80);
  93.    {same as get_def but appends '(Enter)=none?' to the end of the default}
  94.  
  95. procedure get_defen(prompt: string80);
  96.    {same as get_def but the default is always '(Enter)=none?'}
  97.  
  98. procedure get_defyn(prompt: string80; default: boolean);
  99.    {get input with yes/no default based on boolean value}
  100.  
  101.  
  102.  
  103. (* ---------------------------------------------------------------- *)
  104. (* low level input and output *)
  105.  
  106. function nomore: boolean;      
  107.    {prompts "more?" when needed, 
  108.     returns TRUE if user answers 'no' or uses ^K}
  109.  
  110. procedure display_file_raw(name: string; remove_semicolons);
  111.    {display a file with semicolons in column 1 changed to spaces (script0)}
  112.  
  113. procedure display_file_raw(name: string; remove_paths);
  114.    {display a file with all drive and directory names excluded}
  115.  
  116. procedure display_file_raw(name: string; dir_colorize);
  117.    {display a DIR file with automatic colorization}
  118.  
  119.  
  120. function get_key: char;        
  121.    {wait for single key; no echo}
  122.  
  123. function key_ready: boolean;
  124.    {is a key waiting (local or remote)}
  125.  
  126. function time_key(ms: real): char;
  127.    {wait for a key; returns chr(0) if no key is pressed with
  128.     'ms' thousandths of a second}
  129.  
  130.  
  131. procedure check_carrier_loss;   
  132.    {set dump_user and print msg on carrier loss}
  133.  
  134. function carrier_present: boolean;
  135.    {returns TRUE only if carrier is present}
  136.  
  137. procedure transmit_data(s:    string);
  138.    {send a string to the modem without echo to the local display}
  139.  
  140. procedure flush_com;
  141.    {wait for all requested output to be sent to the modem}
  142.  
  143. procedure lower_dtr;
  144.    {force the modem to hang-up}
  145.  
  146. procedure raise_dtr;
  147.    {allow the modem to operate again}
  148.  
  149. procedure force_offhook;
  150.    {hang up and then place the  modem off-hook}
  151.  
  152.  
  153. procedure line_input(var line: string;     {read input into this variable}
  154.                      maxlen:   integer;    {maximum length of input}
  155.                      echo:     boolean;    {echo to screen? dots if false}
  156.                      autocr:   boolean);   {automatic C/R when full?}
  157.    {line input with full control}
  158.  
  159. function scan_nextpar(var cmdline: string): string;
  160.    {scan a string and return the next ";" or " " delimited parameter;
  161.     removes the param from the input string; used in command stacking}
  162.  
  163. procedure popup_prompt(prompt: string; var answer: string);
  164.    {prompt for input; erase prompt afterwards}
  165.  
  166.  
  167. (* ---------------------------------------------------------------- *)
  168. (* color control *)
  169.  
  170. function aBLUE:    string;
  171. function aCYAN:    string;      {output ansi color codes}
  172. function aGRAY:    string;      {return null strings in non-graphic mode}
  173. function aGREEN:   string;
  174. function aGREY:    string;
  175. function aMAGENTA: string;
  176. function aRED:     string;
  177. function aWHITE:   string;
  178. function aYELLOW:  string;
  179.  
  180. procedure default_color;
  181.    {change display to the default color (as defined in pcbsetup)}
  182.  
  183.  
  184. (* ---------------------------------------------------------------- *)
  185. (* pcboard information functions *)
  186.  
  187. function expert:   boolean;        {expert flag set?}
  188. function graphics: boolean;        {ansi graphics flag set?}
  189. function local:    boolean;        {local mode?, no com port}
  190.  
  191.  
  192. function minutes_left: integer;
  193.    {minutes left before automatic logoff}
  194.  
  195. function time_used: integer;       
  196.    {minutes used since login}
  197.  
  198. procedure adjust_time_allowed(seconds: real);
  199.    {add or subtract online time}
  200.  
  201. procedure check_time_left;
  202.    {print a message and set dump_user if time has run out}
  203.  
  204. procedure display_time(true);
  205.    {display (xxxx used, xxxx left)}
  206.  
  207. procedure display_time(false);
  208.    {display (xxxx left)}
  209.  
  210.  
  211. function conference_name: string;      
  212.    {example: 'Main Board' or 'xxxx Conference'}
  213.  
  214. function download_k_allowed: real;
  215.    {how many K bytes are left for downloading?}
  216.  
  217.  
  218. function event_run_needed(event_now): boolean;
  219.    {will event be started immediately if the caller logs off right now?}
  220.  
  221. function event_run_needed(event_possible): boolean;
  222.    {will the event be due if the caller uses all available time}
  223.  
  224. function minutes_before_event: integer;
  225.    {how many minutes before the event is to be started?}
  226.  
  227.  
  228. function verify_level(func: char): boolean;       
  229.    {example:  verify_level('D') = true 
  230.     if pcboard 'D' command is allowed;
  231.     logs security violation if not}
  232.    
  233. procedure make_log_entry (entry: string;        {message to log}
  234.                           echo: boolean);       {also display if true}
  235.    {make an entry in caller log; 
  236.     also echo to screen if second param is TRUE}
  237.  
  238. procedure chat_mode;
  239.    {activate sysop-chat mode}
  240.  
  241. procedure operator_page;
  242.    {page sysop and possibly enter chat mode}
  243.  
  244. procedure online_user_update;
  245.    {edit user password, phone numbers, security level, conference
  246.     registrations, etc}
  247.  
  248.  
  249. (* ---------------------------------------------------------------- *)
  250. (* utilities *)
  251.  
  252. procedure replace_string( var line: string; oldstr, newstr: string);
  253.    {scans line and replaces all occurences of 'oldstr' with 'newstr'}
  254.  
  255. procedure stoupper(var st: string);  
  256.    {map string to all upper case}
  257.  
  258. procedure strip_trailing(var s: string);
  259.    {remove trailing spaces from a string variable}
  260.  
  261. function get_environment_var(id: string): string;
  262.    {returns the value of an envionment variable;
  263.     example: get_environment_var('PATH=') returns "C:\;C:\BATCH..."}
  264.  
  265.  
  266. function get_time: real;  
  267.    {returns the time of day in seconds since midnight}
  268.  
  269. function todays_date_mmddyy: string8;   {format: mmddyy}
  270. function todays_date_yymmdd: string8;   {format: yymmdd}
  271. function system_date: string;           {format: mm-dd-yy}
  272. function system_time: string;           {format: hh:mm}
  273.  
  274. function expdate(yymmdd: string): string;
  275.    {convert mmddyy to mm-dd-yy}
  276. function mmddyy_to_yymmdd(mmddyy: string8): string8;
  277.    {convert mmddyy to yymmdd}
  278. function yymmdd_to_mmddyy(yymmdd: string8): string8;
  279.    {convert yymmdd to mmddyy}
  280.  
  281.  
  282.  
  283. (* ---------------------------------------------------------------- *)
  284. (* data type conversion *)
  285.  
  286. function wtoa(w:   word):    string;   {word to ascii}
  287. function ltoa(int: longint): string;   {longint to ascii}
  288. function itoa(int: integer): string;   {integer to ascii}
  289.  
  290. function atof(asc: string):  real;     {ascii to float}
  291. function atoi(asc: string):  integer;  {ascii to integer}
  292. function atol(asc: string):  longint;  {ascii to longint}
  293. function atow(asc: string):  word;     {ascii to word}
  294.  
  295.  
  296. function ftoa(f: real; width,dec: integer): string;
  297.    {convert pascal floating to string with specified width and decimal places}
  298.  
  299. function stof(B: single): real; {convert 4 byte single (basic format) to real}
  300. function dtof(B: double): real; {convert 8 byte double (basic format) to real}
  301. procedure ftod(PasReal: real; var B: double); {convert real to 8 byte double}
  302. procedure ftos(PasReal: real; var B: single); {convert real to 4 byte single}
  303.  
  304. function stoa(s: single): string;       {convert single to ascii}
  305. function stol(s: single): longint;      {convert single to longint}
  306.  
  307.